<template>
  <el-popconfirm :title="text" v-bind="$attrs" @confirm="confirm">
    <el-button
      slot="reference"
      :disabled="btnDisabled"
      :class="{ 'ml-1': ml }"
      :type="btnType"
    >{{ title }}</el-button>
  </el-popconfirm>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: ''
    },
    text: {
      type: String,
      default: ''
    },
    btnType: {
      type: String,
      default: 'text'
    },
    ml: {
      type: Boolean,
      default: true
    },
    btnDisabled: Boolean
  },
  methods: {
    confirm() {
      this.$emit('confirm')
    }
  }
}
</script>
